import Vue from "vue";
import Vuex from "vuex";
import createPersistedState from "vuex-persistedstate";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    loading: false,
  },
  mutations: {
    setLoading(state, isTrue) {
      state.loading = isTrue;
    },
  },
  modules: {},
  plugins: [
    createPersistedState({
      storage: window.localStorage,
      reducer(state) {
        return {
          // locale: state.locale,
        };
      },
    }),
  ],
});
